
package com.plian.system.service.pm.property.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.plian.Tools.CollectionUtil;
import com.plian.system.entity.pm.property.ShareholdingBasics;
import com.plian.system.mapper.pm.property.ShareholdingBasicsMapper;
import com.plian.system.service.pm.property.IShareholdingBasicsService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务实现类
 *
 * @author jianglei
 * @since 2019-12-05
 */
@Slf4j
@Service
@AllArgsConstructor
public class ShareholdingBasicsServiceImpl extends ServiceImpl<ShareholdingBasicsMapper, ShareholdingBasics> implements IShareholdingBasicsService {

    @Override
    public boolean removeByPropertyId(List<String> propertyIds) {
        if (CollectionUtil.isEmpty(propertyIds)){
            return true;
        }
        return remove(new QueryWrapper<ShareholdingBasics>().in("property_id", propertyIds));
    }

    @Override
    public List<ShareholdingBasics> findByPropertyId(String propertyId) {
        return list(new QueryWrapper<ShareholdingBasics>().eq("property_id", propertyId));
    }

}
